package edu.udel.mboch.towerdefense;

import java.util.ArrayList;

public class SinglePlayerGrid extends Grid
{	
	private static final long serialVersionUID = -2561192332550584460L;

	public SinglePlayerGrid(Position spawn, Position end, Terrain[][] terrainGrid)
	{
		super(spawn, end, terrainGrid);
		
	}
	
	public SinglePlayerGrid(Tower[][] towerGrid, Mob[][] mobGrid, Terrain[][] terrainGrid, Position spawn, Position end, ArrayList<PathPosition> path, ArrayList<Mob> mobs, ArrayList<Projectile> projectiles)
	{
		super(towerGrid, mobGrid, terrainGrid, spawn, end, path, mobs, projectiles);
		this.path = path;
	}
	
	public SinglePlayerGrid copy()
	{
		Tower[][] tCopy = new Tower[MAX_Y][MAX_X];
		Mob[][] mCopy = new Mob[MAX_Y][MAX_X];
		for(int i = 0; i<MAX_Y; i++)
			for(int j = 0; j<MAX_X; j++)
			{
				if(towerGrid[i][j] != null)
					tCopy[i][j] = towerGrid[i][j].copy();
				if(mobGrid[i][j] != null)
					mCopy[i][j] = mobGrid[i][j].copy();
			}
		return new SinglePlayerGrid(tCopy, mCopy, terrainGrid, spawn, end, path, mobs, projectiles);
	}
}
